home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / fax / src / port / sco / flexfax.rc < prev    next >
Text File  |  1994-08-01  |  3KB  |  118 lines

  1. #! /bin/sh
  2. #    $Header: /usr/people/sam/fax/port/sco/RCS/flexfax.rc,v 1.1 1994/04/18 18:46:51 sam Rel $
  3. #
  4. # FlexFAX Facsimile Software
  5. #
  6. # Copyright (c) 1990, 1991, 1992, 1993, 1994 Sam Leffler
  7. # Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
  8. # Permission to use, copy, modify, distribute, and sell this software and 
  9. # its documentation for any purpose is hereby granted without fee, provided
  10. # that (i) the above copyright notices and this permission notice appear in
  11. # all copies of the software and related documentation, and (ii) the names of
  12. # Sam Leffler and Silicon Graphics may not be used in any advertising or
  13. # publicity relating to the software without the specific, prior written
  14. # permission of Sam Leffler and Silicon Graphics.
  15. # THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
  16. # EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
  17. # WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
  18. # IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
  19. # ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
  20. # OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  21. # WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
  22. # LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
  23. # OF THIS SOFTWARE.
  24. #
  25.  
  26. #
  27. # Script for starting FlexFAX faxd at system boot.
  28. # On SCO:
  29. #    Copy this script to /etc/init.d/flexfax
  30. #    Set the permissions to 744
  31. #    Set the owner to 'root'
  32. #    Set the group to 'sys'
  33. #    Link /etc/init.d/flexfax /etc/rc0.d/K80fax
  34. #    Link /etc/init.d/flexfax /etc/rc2.d/S80fax
  35. #
  36.  
  37.  
  38. #
  39. # Check this is where you have faxd and faxquit installed.
  40. #
  41. FAXD=/usr/local/lib/fax/faxd
  42. FAXQUIT=/usr/local/bin/faxquit
  43.  
  44. #
  45. # Specify space seperated list of port(s) to service
  46. # relative to /dev. e.g. PORTS="ttyA01 ttyA02 tty1A"
  47. #
  48. PORTS=
  49.  
  50.     state=$1
  51.     rc=0
  52.  
  53.     if [ "x$state" = "x" ]
  54.     then
  55.         echo "$0: Must give argument \"start\" or \"stop\"\n"
  56.         exit 1
  57.     fi
  58.  
  59.     if [ "x$PORTS" = "x" ]
  60.     then
  61.         echo "$0: No devices specified, please read script\n"
  62.         exit 1
  63.     fi
  64.  
  65.     case $state in
  66.         'start')
  67.             if [ "$9" = "2" -o "$9" = "3" ]
  68.             then
  69.                 exit $rc
  70.             fi
  71.  
  72.             if [ -x "$FAXD" ] 
  73.             then
  74.                 for port in $PORTS
  75.                 do
  76.                     echo "Starting up FlexFAX deamon on $port ... \c"
  77.                     $FAXD -m /dev/$port
  78.  
  79.                     if [ $? = 0 ]
  80.                     then
  81.                         echo "[faxd startup completed]"
  82.                     else
  83.                         echo "[faxd startup failed on $port]"
  84.                         rc=1
  85.                     fi
  86.                 done
  87.             else
  88.                 echo "FlexFAX startup failed: could not exec $FAXD"
  89.             fi
  90.         ;;
  91.  
  92.         'stop')
  93.             if [ -x "$FAXQUIT" ] 
  94.             then
  95.                 for port in $PORTS
  96.                 do
  97.                     echo "Stopping FlexFAX deamon on $port ... \c"
  98.                     $FAXQUIT /dev/$port
  99.  
  100.                     if [ $? = 0 ]
  101.                     then
  102.                         echo "[faxd shutdown completed]"
  103.                     else
  104.                         echo "[faxd shutdown failed on $port]"
  105.                         rc=1
  106.                     fi
  107.                 done
  108.             else
  109.                 echo "FlexFAX shutdown failed: could not exec $FAXQUIT"
  110.             fi
  111.         ;;
  112.     esac
  113.  
  114.     exit $rc
  115.